package leetcode_2001_2100;

public class LeeCode_2087 {
    public static void main(String[] args) {

    }
    private static int minCost(int[] startPos, int[] homePos, int[] rowCosts, int[] colCosts) {
        int ans = 0;
        if (startPos[0] <= homePos[0]){
            for (int i = startPos[0] + 1; i <= homePos[0]; i++) {
                ans += rowCosts[i];
            }
        }else {
            for (int i = homePos[0]; i < startPos[0]; i++) {
                ans += rowCosts[i];
            }
        }
        if (startPos[1] <= homePos[1]){
            for (int i = startPos[1] + 1; i <= homePos[1]; i++) {
                ans += colCosts[i];
            }
        }else {
            for (int i = homePos[1]; i < startPos[1]; i++) {
                ans += colCosts[i];
            }
        }
        return ans;
    }
}
